<template>
  <div id="app">
    <div id="nav">
    </div>
    <router-view/>
  </div>
</template>
<script>
export default {
   mounted(){
     this.init()
   },
   methods:{
     init(){
       if(localStorage.getItem('userName')!== null){
         return true
       }else{
         this.$router.push({name:'login'})
       }
     }
   }
}
</script>
<style>
#app {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
</style>
